#include <iostream>
using namespace std;
int main()
{
	long long m;
	long long k, count = 0;
	cin >> m >> k;
	while(m != 0)
	{
		if(m % 10 == 3)
			count++;
		m /= 10;
	}
	if(count == k)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
} 
